<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='护理管理-编辑',cssPaths='/static/css/services/records/add.css',jsPaths='/static/js/services/records/add.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
                <span class="layui-breadcrumb" lay-separator=">">
                    <a th:href="@{/}">首页</a>
                    <a href="">护理管理</a>
                    <a href="/records">护理记录</a>
                    <a><cite>编辑</cite></a>
                </span>
    </div>

    <!--主体内容区-->
    <div class="form-content layui-container">
        <form class="layui-form" th:action="@{/records/update}" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">老人编号</label>
                <div class="layui-input-block">
                    <input type="text" name="elderlyCode" id="elderlyCode" th:value="${records.elderlyCode}"   lay-verify="required|exists" placeholder="请输入老人编号" autocomplete="off" class="layui-input">
                    <input type="hidden" name="id" th:value="${records.id}">
                </div>
            </div>
            <div id="elderlyInfo" style="padding-left:110px;margin-bottom:10px;">
                <div>
                    老人姓名：<span th:text="${records.elderlyName}"></span>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">项目名称</label>
                <div class="layui-input-block">
                    <select name="itemId" lay-filter="xmmc" lay-verify="required">
                        <option value=""></option>
                        <option  th:each="item:${items}" th:value="${item.id}" th:text="${item.name}" th:data-price="${item.price}" th:data-type="${item.type}" th:selected="${records.itemId} eq ${item.id}"></option>
                    </select>
                    <input type="hidden" name="itemName" th:value="${records.itemName}" id="itemName">
                    <input type="hidden" name="type" th:value="${records.type}" id="type">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">费用</label>
                <div class="layui-input-inline">
                    <input type="text" name="cost" id="cost"  readonly  lay-verify="required" placeholder="请输入费用" th:value="${records.cost}" autocomplete="off" class="layui-input layui-disabled">
                </div>
                <div class="layui-form-mid layui-word-aux">单位：元 不收费项目请设置费用为0</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">服务时间</label>
                <div class="layui-input-block">
                    <input type="text" name="serviceDate" th:value="${#dates.format(records.serviceDate,'yyyy-MM-dd')}" id="serviceDate"  placeholder="请选择服务时间" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-block">
                    <textarea name="remark" placeholder="备注" class="layui-textarea" th:text="${records.remark}"></textarea>
                </div>
            </div>

            <div class="healthDatabox" th:style="'display:' + @{(${records.type != 2} ? 'none' : 'block')} + ''">
                <blockquote class="layui-elem-quote layui-quote-nm" style="color:orangered;font-size: 18px;margin-left: 110px;">请录入本次服务所得健康数据</blockquote>
                <div class="healthDataItem" th:if="${healthDataList}" th:each="hd:${healthDataList}">
                    <div class="layui-form-item">
                        <label class="layui-form-label" th:text="${hd.healthDataitemName}"></label>
                        <div class="layui-input-inline">
                            <input type="text" name="value" th:value="${hd.value}"   lay-verify="required" placeholder="请输入结果" autocomplete="off" class="layui-input">
                            <input type="hidden" name="healthDataItemId" th:value="${hd.healthDataItemId}" />
                            <input type="hidden" name="healthDataitemName" th:value="${hd.healthDataitemName}" />
                            <input type="hidden" name="standardValues" th:value="${hd.standardValues}" />
                        </div>
                        <div class="layui-input-inline">
                            <select name="nature" lay-verify="required">
                                <option value="0" th:selected="!${hd.nature}">阴性</option>
                                <option value="1" th:selected="${hd.nature}">阳性</option>
                            </select>
                        </div>
                        <div class="layui-input-inline" style="height: 38px;line-height: 38px;">
                            参考值：<span th:text="${hd.standardValues}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="text" name="description" th:value="${hd.description}" placeholder="详细描述或建议,无则不填" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="submitBtn">保存</button>
                    <a href="/records" class="layui-btn layui-btn-primary">返回</a>
                </div>
            </div>
        </form>

    </div>
</div>
</html>